<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>测试HelloWorld</title>
	</head>

	<body>
		<div><span>Hello World!</span></div>
		<div><span>Hello World!</span></div>
		<div><span>Hello World!</span></div>
		<div><span>Hello World!</span></div>
		<div><span>Hello World!</span></div>
		<div><span>Hello World!</span></div>
	</body>

	<script type="text/javascript">
		window.onload = function() {
			
			var count = 0;
			var spans = document.getElementsByTagName("span");
			for(var i=0;i<spans.length;i++){
				var content = spans[i].textContent;
				if(content.startsWith("Hello")){
					count++;
				}
			}
			console.log("resultCount=" + count)	;		
		}
	</script>

</html>